# the minimum version of CMake.
cmake_minimum_required(VERSION 3.5.0)
project(InspireFaceTest)

set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
message(STATUS "NATIVERENDER_ROOT_PATH: ${NATIVERENDER_ROOT_PATH}")
if(DEFINED PACKAGE_FIND_FILE)
    include(${PACKAGE_FIND_FILE})
endif()

include_directories(${NATIVERENDER_ROOT_PATH}
                    ${NATIVERENDER_ROOT_PATH}/include
                    ${NATIVERENDER_ROOT_PATH}/inspireface
                    ${NATIVERENDER_ROOT_PATH}/inspireface/middleware
                    ${NATIVERENDER_ROOT_PATH}/inspireface/pipeline_module
                    ${NATIVERENDER_ROOT_PATH}/inspireface/recognition_module
                    ${NATIVERENDER_ROOT_PATH}/inspireface/c_api
                    ${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/Eigen
                    ${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/inspireCV
                    ${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/inspireCV/include/inspirecv
                    ${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/inspireCV/src/inspirecv/impl/okcv
                    ${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/InspireCV/include/inspirecv/core
                    ${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp
                    ${NATIVERENDER_ROOT_PATH}/inspireface/common
                    ${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/inspireCV/include
                    ${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/inspireCV/include/inspirecv/core
                    ${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/include
                    ${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/include/yaml-cpp
                    ${NATIVERENDER_ROOT_PATH}/inspireface/c_api
                    ${NATIVERENDER_ROOT_PATH}/inspireface/common/face_data
                    ${NATIVERENDER_ROOT_PATH}/inspireface/common/face_info
                    ${NATIVERENDER_ROOT_PATH}/inspireface/initialization_module
                    ${NATIVERENDER_ROOT_PATH}/inspireface/track_module
                    ${NATIVERENDER_ROOT_PATH}/../../../libs/${OHOS_ARCH}/mnn/include/MNN
                    )
# 添加 MNN 库文件路径
link_directories(
    ${NATIVERENDER_ROOT_PATH}/../../../libs/${OHOS_ARCH}
)

add_library(hfacedetect SHARED napi_init.cpp
${NATIVERENDER_ROOT_PATH}/HYDetect.cpp
${NATIVERENDER_ROOT_PATH}/HYFaceDetectManager.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/c_api/inspireface.cc
${NATIVERENDER_ROOT_PATH}/inspireface/initialization_module/resource_manage.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/InspireCV/src/inspirecv/impl/image.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/InspireCV/src/inspirecv/impl/point.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/InspireCV/src/inspirecv/impl/rect.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/log.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/face_session.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/initialization_module/hlaunch.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/InspireCV/src/inspirecv/okcv/image.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/InspireCV/src/inspirecv/impl/transform_matrix.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/inspireCV/src/inspirecv/logging.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/track_module/face_track_module.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/recognition_module/face_feature_extraction_module.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/pipeline_module/face_pipeline_module.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/middleware/model_archive/microtar/microtar.c
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/parse.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/exceptions.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/node_data.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/memory.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/InspireCV/src/inspirecv/okcv/geometry/transform_matrix.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/track_module/landmark/face_landmark_adapt.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/track_module/face_detect/rnet_adapt.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/track_module/quality/face_pose_quality_adapt.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/InspireCV/src/inspirecv/costman.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/track_module/face_detect/face_detect_adapt.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/track_module/tracker_optional/bytetrack/BYTETracker.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/middleware/inference_helper/inference_helper.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/InspireCV/src/inspirecv/impl/size.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/convert.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/track_module/tracker_optional/bytetrack/STrack.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/recognition_module/extract/extract_adapt.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/pipeline_module/attribute/mask_predict_adapt.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/pipeline_module/liveness/rgb_anti_spoofing_adapt.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/pipeline_module/liveness/blink_predict_adapt.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/pipeline_module/attribute/face_attribute_adapt.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/parser.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/nodebuilder.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/middleware/nexus_processor/image_processor.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/track_module/tracker_optional/bytetrack/kalmanFilter.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/track_module/tracker_optional/bytetrack/utils.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/scanner.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/directives.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/singledocparser.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/middleware/inference_helper/inference_helper_mnn.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/middleware/nexus_processor/image_processor_general.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/track_module/tracker_optional/bytetrack/lapjv.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/stream.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/scantoken.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/simplekey.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/regex_yaml.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/null.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/tag.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/scantag.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/scanscalar.cpp
${NATIVERENDER_ROOT_PATH}/inspireface/3rdparty/yaml-cpp/src/exp.cpp

)
target_link_libraries(hfacedetect PUBLIC libace_napi.z.so libMNN.so libhilog_ndk.z.so
   libohfileuri.so)
